package com.nanhai.buddhist.college.module.collegebase.dal.mysql.studentchangelog;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.studentchangelog.vo.StudentChangeLogExportReqVO;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.studentchangelog.vo.StudentChangeLogPageReqVO;
import com.nanhai.buddhist.college.module.collegebase.dal.dataobject.studentchangelog.StudentChangeLogDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.studentchangelog.vo.*;

/**
 * 信息异动记录 Mapper
 *
 * @author AKai
 */
@Mapper
public interface StudentChangeLogMapper extends BaseMapperX<StudentChangeLogDO> {

    default PageResult<StudentChangeLogDO> selectPage(StudentChangeLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudentChangeLogDO>()
                .eqIfPresent(StudentChangeLogDO::getNewStatus, reqVO.getNewStatus())
                .eqIfPresent(StudentChangeLogDO::getCheckUser, reqVO.getCheckUser())
                .orderByDesc(StudentChangeLogDO::getCreateTime));
    }

    default List<StudentChangeLogDO> selectList(StudentChangeLogExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<StudentChangeLogDO>()
                .eqIfPresent(StudentChangeLogDO::getNewStatus, reqVO.getNewStatus())
                .eqIfPresent(StudentChangeLogDO::getCheckUser, reqVO.getCheckUser())
                .orderByDesc(StudentChangeLogDO::getCreateTime));
    }

}
